Page({
  data: {
    inputShowed: false,
    inputVal: "",
    widths: wx.getSystemInfoSync().windowWidth,
  },
  onLoad:function(){
  
  },
  onShow:function(){
    wx.getClipboardData({
      success: function (res) {
        if (res.data != "") {
          wx.showModal({
            title: '是否搜索以下内容',
            content: res.data,
            success: function (rs) {
              if (rs.confirm) {
                wx.navigateTo({
                  url: '/pages/search/search?value=' + res.data + "&action=do",
                })
              } else if (rs.cancel) {
                // console.log('用户点击取消')
              }
            }
          })

        }
      }
    })
  },
  showInput: function () {
    this.setData({
      inputShowed: true
    });
  },
  inputTyping: function (e) {
    this.setData({
      inputVal: e.detail.value
    });
  },
  searchData: function (e) {
   // console.log(e.detail)
    this.setData({
      inputVal: e.detail.value
    })
  },
  startSearch: function (e) {
    wx.navigateTo({
      //目的页面地址
      url: '../../pages/search/search?value=' + e.detail.value+"&action=do",
      success: function (res) { 
       // console.log("success")
      },
    })
  }
});
